<%-- 
    Document   : enchere
    Created on : 5 avr. 2013, 14:22:59
    Author     : Alice
--%>

<%@page import="java.util.ArrayList"%>
<%@page import="com.paris5.master2.guitarmaster.bean.EcomBid"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html>

<jsp:include page="header.jsp"></jsp:include>

<s:div id="bloc_contenu_avec_trait_orange">

    <H2 class="colorEnchere">${message}</H2>

    <s:set var="counter" value="0"/>

    <c:forEach items="${enchereProducts}" var="enchere" varStatus="status">

        <s:div id="bloc_produit">
            <table border="0">
                <tr>
                    <td valign="top" class="td_miniature"><img src="pages/img/img_produit_type/${enchere.idProductType}.jpg" width="90%" height="90%"/></td>
                    <td valign="top">
                        <c:set var="idProduct" value="${enchere.idProduct}"/>
                        
                            <b>${enchere.title}</b>
                       
                        <br /><br />${enchere.description}<br /><br /><br />

                        Date de mise en enchère : <fmt:formatDate value="${enchere.createDate}" pattern="dd/MM/yyyy à HH:mm"/>   <br />
                        Date de fin de l'enchère : <fmt:formatDate value="${enchere.bidEndDate}" pattern="dd/MM/yyyy à HH:mm"/> <br /><br />

                        Magasin : ${enchere.store.name} <br />
                        Adresse : ${enchere.store.adresse}  <br />
                        Pays : ${enchere.store.code.label}
                    </td>
                    <td valign="top" class="td_miniature"><font color="orange" size="4"><b>
                            <c:if test="${not empty listLastBibProduct}">
                                <s:if test="#session['USER'] != null">
                                    <s:if test="#session['USER'].getCountry().devise=='USD'">
                                        <fmt:formatNumber maxFractionDigits="2"><c:out value="${listLastBibProduct[counter].getBidPrice()*sessionScope['RATE']}" /></fmt:formatNumber> $
                                    </s:if>
                                    <s:else>
                                        <c:out value="${listLastBibProduct[counter].getBidPrice()}"/> €
                                    </s:else>
                                </s:if>
                                    <s:else>
                                        <c:out value="${listLastBibProduct[counter].getBidPrice()}"/> €
                                    </s:else>
                            </c:if>
                            <c:if test="${empty listLastBibProduct}">
                                <c:out value="non affiché"/>
                            </c:if>

                        </b></font><br />
                        Prix original <s:if test="#session['USER'] != null">
                                    <s:if test="#session['USER'].getCountry().devise=='USD'">
                                        <fmt:formatNumber maxFractionDigits="2"><c:out value="${enchere.price*sessionScope['RATE']}" /></fmt:formatNumber> $
                                    </s:if>
                                    <s:else>
                                        ${enchere.price} €
                                    </s:else>
                                </s:if>
                                <s:else>
                                    ${enchere.price} €
                                </s:else>
                        <br /><br />
                        <c:if test="${empty sessionScope['USER']}">                                                  
                            <a href="connection.jsp">Connectez-vous pour enchérir</a> 
                        </c:if>
                        <s:if test="#session['USER'] != null">
                            <s:a action="ficheProduitEnchere">
                                <s:param name="idProduct"><c:out value="${idProduct}"/></s:param>
                                    <b>Je souhaite enchérir</b>
                            </s:a>
                        </s:if>


                    </td>
                </tr>

            </table>
        </s:div>
        <s:set var="counter" value="%{#counter+1}"/>
    </c:forEach>

</s:div>

<jsp:include page="footer.jsp"></jsp:include>
